﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Data;

namespace DataSets
{
    public partial class EASADataSet
    {
        /// <summary>
        /// Get all of the station codes
        /// </summary>
        /// <returns></returns>
        public string[] StationCodes(string aVesselCode, string aCruise)
        {
            return this.events.Where(
                    qR => qR.stationsRow != null &&
                    qR.stationsRow.CRUISE == aCruise &&
                    qR.stationsRow.VESSEL == aVesselCode &&
                    qR.longlineRow != null)
                    .Select(qR => qR.stationsRow.PASC).ToArray();
        }
        public EASADataSet.longlineRow GetLonglineRow(string aVesselCode, string aCruise, string aStation)
        {
            return this.events.Where(
                    qR => qR.stationsRow != null &&
                    qR.stationsRow.CRUISE == aCruise &&
                    qR.stationsRow.VESSEL == aVesselCode &&
                    qR.stationsRow.PASC == aStation)
                    .Select(qR=>qR.longlineRow)
                    .First();
        }
    }
}
